import '../item_style.dart';
import '../tooltip.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'funnel_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class FunnelEmphasis {
  var focus;
  var blurScope;

  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  FunnelEmphasis(
      {this.focus, this.blurScope, this.itemStyle, this.labelLine, this.label});

  factory FunnelEmphasis.fromJson(Map<String, dynamic> json) =>
      _$FunnelEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$FunnelEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class FunnelBlurSelectEmphasis {
  SeriesLabel? label;
  LabelLine? labelLine;
  ItemStyle? itemStyle;

  FunnelBlurSelectEmphasis({this.itemStyle, this.label, this.labelLine});

  factory FunnelBlurSelectEmphasis.fromJson(Map<String, dynamic> json) =>
      _$FunnelBlurSelectEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$FunnelBlurSelectEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class FunnelData {
  var name;
  var value;
  ItemStyle? itemStyle;
  SeriesLabel? label;
  LabelLine? labelLine;
  FunnelBlurSelectEmphasis? emphasis;
  FunnelBlurSelectEmphasis? blur;
  FunnelBlurSelectEmphasis? select;
  Tooltip? tooltip;

  FunnelData(
      {this.name,
      this.value,
      this.itemStyle,
      this.label,
      this.labelLine,
      this.emphasis,
      this.blur,
      this.select,
      this.tooltip});

  factory FunnelData.fromJson(Map<String, dynamic> json) =>
      _$FunnelDataFromJson(json);

  Map<String, dynamic> toJson() => _$FunnelDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class FunnelSeries extends Series {
  var type = 'funnel';
  var id;

  var name;

  var min;
  var max;
  var minSize;
  var maxSize;
  var orient;
  var sort;
  var gap;
  var legendHoverLink;
  var funnelAlign;

  SeriesLabel? label;
  LabelLine? labelLine;

  ItemStyle? itemStyle;
  LabelLayout? labelLayout;
  FunnelEmphasis? emphasis;

  FunnelBlurSelectEmphasis? blur;
  FunnelBlurSelectEmphasis? select;
  var selectedMode;
  var zlevel;
  var z;
  var left;
  var top;
  var right;
  var bottom;
  var width;
  var height;
  var seriesLayoutBy;
  var datasetIndex;
  var dimensions;
  var encode;

  List<FunnelData>? data;
  MarkPoint? markPoint;
  MarkLine? markLine;
  MarkArea? markArea;
  var silent;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;
  Tooltip? tooltip;

  FunnelSeries(
      {this.id,
      this.name,
      this.min,
      this.max,
      this.minSize,
      this.maxSize,
      this.orient,
      this.sort,
      this.gap,
      this.legendHoverLink,
      this.funnelAlign,
      this.label,
      this.labelLine,
      this.itemStyle,
      this.labelLayout,
      this.emphasis,
      this.blur,
      this.select,
      this.selectedMode,
      this.zlevel,
      this.z,
      this.left,
      this.top,
      this.right,
      this.bottom,
      this.width,
      this.height,
      this.seriesLayoutBy,
      this.datasetIndex,
      this.dimensions,
      this.encode,
      this.data,
      this.markPoint,
      this.markLine,
      this.markArea,
      this.silent,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate,
      this.tooltip});

  factory FunnelSeries.fromJson(Map<String, dynamic> json) =>
      _$FunnelSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$FunnelSeriesToJson(this);
}
